package com.hsy.linemoney.modules.account;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.hsy.linemoney.R;
import com.hsy.linemoney.modules.common.CommonBaseActivityWithSimpleActionBar;

/**
 * Created by Administrator on 2016/7/12.
 */
public class AddAccountActivity extends CommonBaseActivityWithSimpleActionBar {
    private TextView add_finish, user_line, bank_edit_line, phone_line, code_line;
    private EditText bank_edit, user, phone, code;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setTitle("添加银行卡");
        setContentView(R.layout.activity_add_account);
        add_finish = F(R.id.add_finish);
        add_finish.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });


        user = F(R.id.user);
        user_line = F(R.id.user_line);
        editTextLine(user, user_line);

        bank_edit_line = F(R.id.bank_edit_line);
        bank_edit = F(R.id.bank_edit);
        editTextLine(bank_edit, bank_edit_line);

        phone = F(R.id.phone);
        phone_line = F(R.id.phone_line);
        editTextLine(phone, phone_line);



    }

    private void editTextLine(EditText editText, final TextView line) {
        editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                if (hasFocus) {
                    line.setBackgroundDrawable(getResources().getDrawable(R.color.color_action_bar_bg));
                } else {
                    line.setBackgroundDrawable(getResources().getDrawable(R.color.line));
                }
            }
        });

    }
}
